while True:
    try:
        grades_judgment = int(input('输出您的成绩：'))
        break #如果输入正确就跳出循环
    except ValueError:#ValueError捕捉输入的是非数字错误
        print('输入无效，请输入一个有效数字')
if 90 <= grades_judgment <= 100:
    print('A')
elif 80 <= grades_judgment < 90:
    print('B')
elif 60 <= grades_judgment < 80:
    print('C')
elif 0 <= grades_judgment < 60:
    print('D')
else:
    print("请输入0-100数字")
